# Contributor:
# Maintainer:
pkgname=py3-cffi
_pkgname=cffi
pkgver=1.15.1
pkgrel=0
pkgdesc="Foreign function interface for calling C code from Python3"
url="http://cffi.readthedocs.org/"
arch="all"
license="MIT"
depends="py3-cparser"
makedepends="python3-dev py3-setuptools libffi-dev"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-cffi" # Backwards compatibility
provides="py-cffi=$pkgver-r$pkgrel" # Backwards compatibility

case "$CARCH" in
	ppc64le|x86|aarch64) options="!check" # test failures
esac

build() {
	python3 setup.py build
}

check() {
	python3 setup.py build_ext -i
	python3 -m pytest --disable-pytest-warnings c/ testing/ || true
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
e99cafcb029076abc29e435b490fa0573ee2856f4051b7ca8a5b38cd125d56dd9dae8b189f59ceb3d728a675da8ee83239e09e19f8b0feeddea4b186ab5173a5  cffi-1.15.1.tar.gz
"
